Project tech description
We used web components to build our application, so that each element was reusable, we could easily use each of them on each of the subpages.
We used routing to navigate between pages, we have created functions that handle requests with different HTTP methods and directed to different paths in the URL
To create a database of movies and series, we used the free API from https://imdb-api.com/. ApiProvider provides methods for developers that return data from the API. They themselves directly refer to ApiService which in turn:
- Calls on the CacheManager to check if the request exists in the cache
- If CacheManager returns successfully the data, it is returned from ApiService
- If CacheManager cannot find the data in the cache, it makes a request to a real api server with a key and an appropriate query
- If the request is successful, supports downloading new files to the cache (to be manually added by the developer)
StorageManager provides two simple methods for manipulating data in localStorage.
Each of the components has its own style written in SCSS. We used mixins and created variables, thanks to which our entire application is graphically consistent and compatible with mobile devices.
Project Setup#
Our program can be started directly by clicking on this link.
To run the project locally follow these steps:
- Clone this repository
- Open repository in your code editor
- Go to IMDb API Website, create an account and get your API Key.
- Copy .env.example to .env and setup enviromental variables:
- paste your API Key into API_SECRET_KEY env variable
- set USE_API env variable:
- if equal true - application will call the API if the data was not found in the cache, it will download requests for you to add into cache
- if equal false or any other value - application won't ever call the API even if the data was not found in the cache, it will throw an error
- Run command npm run start:dev
- Enter the local host that was created which by default is http://localhost:8765/
Tech requirements#
To run this project you have to add and enable Prettier
To run this project you have to:
Clone this repository
Go to IMDb API Website, create an account and get your API Key.
Copy
.env.exampleto.envand setup enviromental variables:- paste your API Key into
API_SECRET_KEYenv variable - set
USE_APIenv variable:- if equal
true- application will call the API if the data was not found in the cache, it will download requests for you to add into cache - if equal
falseor any other value - application won't ever call the API even if the data was not found in the cache, it will throw an error
- if equal
- paste your API Key into
Run
npm installin root directoryRun
npm run start:devto open live server
Other commands
npm run build- building the bundled package ready for productionnpm run format- formatting the code using prettiernpm run test- running tests oncenpm run test:watch- running tests in watch modenpm run test:cov- running tests with information about code coverage with tests
Technologies used#
the program was created using the following technologies:
- HTML5
- SCSS
- JavaScript
- FetchAPI
- JEST
- Parcel builder